const express = require('express');

// 导入检验 token 中间件
const testToken = require('../../middleware/auth')

const router = express.Router();

//管理员登录业务
router.use('/login', require('./login'))
//图片上传业务
router.use('/uploads', require('./uploads'))
//其他增加的业务
router.use('/other', testToken(), require('./other'))
//审核
router.use('/examine', testToken(), require('./examine'))
//文件下载/删除
router.use('/files', require('./files'))
//导出
router.use('/export', require('./export'))
//消息
router.use('/journal', require('./journal'))
//增删查改业务
router.use('/:resource', testToken(), require('../../middleware/resource')(), require('./business'))

//错误处理中间键
router.use(require('../../middleware/err-handle')())

module.exports = router
